package com.questionGenerator.commom.context;

public class BaseContext {

    private static ThreadLocal<Long> threadLocalId = new ThreadLocal<>();
    private static ThreadLocal<String> threadLocalName = new ThreadLocal<>();

    public static void setCurrentId(Long id) {
        threadLocalId.set(id);
    }

    public static Long getCurrentId() {
        return threadLocalId.get();
    }

    public static void removeCurrentId() {
        threadLocalId.remove();
    }

    public static void setUserName(String name){threadLocalName.set(name);}

    public static String getCurrentName() {
        return threadLocalName.get();
    }

    public static void removeCurrentName() {
        threadLocalName.remove();
    }



}
